package io;

import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;

public class DataSet {
	
	private CSVParser csvParser = null;
	private List<List<String>> values = new ArrayList<>();
	
	public DataSet(String path) {
		try {
			csvParser = new CSVParser(path);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		
		List<String> line = null;
		while((line = csvParser.nextLine()) != null)
			values.add(line);
	}
	
	public String getValue(int row, int col) {
		return values.get(row).get(col);
	}
	
	public List<String> getRow(int row) {
		return values.get(row);
	}
	
	public int getRowSize() {
		return values.size();
	}
	
	public int getColSize() {
		if(values.isEmpty())
			return -1;
		else
			return values.get(0).size();
	}
}
